﻿using IceCS.DesignPattern.Core.AbstractFactoryPattern.WorldThings.Shapes;

namespace IceCS.DesignPattern.Core.AbstractFactoryPattern.WorldThings
{
    /// <summary>
    /// 图形类型
    /// </summary>
    public enum ShapeType
    {
        Circle,
        Rectangle,
        Square
    }

    /// <summary>
    /// 图形工厂
    /// </summary>
    public class ShapeFactory : WorldThingsFactory
    {
        public override IShapeAction GetShape(ShapeType type)
        {
            return type switch
            {
                ShapeType.Circle => new Circle(),
                ShapeType.Square => new Square(),
                ShapeType.Rectangle => new Rectangle(),
                _ => null,
            };
        }

        public override IColorAction GetColor(ColorType type)
        {
            return null;
        }
    }
}

